package gob.minedu.capacitacion.cxa.dao.ibatisImpl;

/**
 * @author pedro rios
 * @date 04/02/14
 */


import gob.minedu.capacitacion.cxa.bean.DocumentoBean;
import gob.minedu.capacitacion.cxa.dao.ibatis.DocumentoDAO;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;


public class DocumentoDAOMysql extends SqlMapClientDaoSupport implements DocumentoDAO {
	

	
	 

	public DocumentoBean getDocumentById(Long idUsuario) {
		try{
			return (DocumentoBean)getSqlMapClientTemplate().queryForObject("getDocumentById", idUsuario);
		}catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error en el ibatis - method getDocumentById()");
			return null;
		}
	}

	@Override
	public boolean insertDocumento(DocumentoBean obj) {
		try {
			 getSqlMapClientTemplate().insert("insertDocumento",obj);	
			 return true;
		} catch (RuntimeException e) {
			e.printStackTrace();
			System.out.println("Error en el ibatis - method insertDocumento()");
			return false;
		}
	}




	
}
